package cn.codeforfun.exchage;

import cn.codeforfun.follower.Follower;
import cn.codeforfun.prize.Prize;

import javax.persistence.*;
import java.io.Serializable;

@Entity
@IdClass(ExchangePK.class)
@Table(name = "follower_vote")
public class Exchange implements Serializable {
    @Id
    private Long followerId;
    @Id
    private Long voteId;
    private Boolean hasExchange = false;//是否抽过奖

    private Boolean hasPrize = false;//是否中奖

    private Long prizeId;//中奖ID

    private Integer code;//中奖码

    private Boolean hasGet = false;//已兑换

    @Transient
    private Follower follower;
    @Transient
    private Prize prize;

    public Exchange() {
    }

    public Exchange(Long followerId, Long voteId) {
        this.followerId = followerId;
        this.voteId = voteId;
    }

    public Long getFollowerId() {
        return followerId;
    }

    public void setFollowerId(Long followerId) {
        this.followerId = followerId;
    }

    public Long getVoteId() {
        return voteId;
    }

    public void setVoteId(Long voteId) {
        this.voteId = voteId;
    }

    public Boolean getHasPrize() {
        return hasPrize;
    }

    public void setHasPrize(Boolean hasPrize) {
        this.hasPrize = hasPrize;
    }

    public Boolean getHasExchange() {
        return hasExchange;
    }

    public void setHasExchange(Boolean hasExchange) {
        this.hasExchange = hasExchange;
    }

    public Long getPrizeId() {
        return prizeId;
    }

    public void setPrizeId(Long prizeId) {
        this.prizeId = prizeId;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public Boolean getHasGet() {
        return hasGet;
    }

    public void setHasGet(Boolean hasGet) {
        this.hasGet = hasGet;
    }

    public Follower getFollower() {
        return follower;
    }

    public void setFollower(Follower follower) {
        this.follower = follower;
    }

    public Prize getPrize() {
        return prize;
    }

    public void setPrize(Prize prize) {
        this.prize = prize;
    }
}
